package com.gperp.controller;

import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import com.gperp.common.GPResult;
import com.gperp.pojo.AsAccountdetail;
import com.gperp.service.AccountDetailService;

@Controller
public class AccountDetailController {
	
	@Resource
	private AccountDetailService accountDetailService;
	
	@RequestMapping(value="accountList",method=RequestMethod.GET)
	@CrossOrigin
	@ResponseBody
	public Map<String,Object> accountList(@RequestParam(defaultValue="1")Integer pageNo,Long userid){
		return accountDetailService.queryList(pageNo,userid);
	}
	
	@RequestMapping(value="saveAccount",method=RequestMethod.POST)
	@CrossOrigin
	@ResponseBody
	public GPResult saveAccount(AsAccountdetail account){
		return accountDetailService.saveAccount(account);
	}
}
